export default {
    name: "Component",
    props: {
        propsData: {
            type: Object,
            default() {
                return {
                    init: true,
                };
            },
        },
        selectBottom: {
            type: Boolean,
            default: false,
        },
    },
    provide() {
        return {
            setChildrenRef: (name, ref) => {
                this[name] = ref;
            },
            getChildrenRef: (name) => {
                return this[name];
            },
            getRef: () => {
                return this;
            },
        };
    },
    data() {
        return {
            paramsData: {},
        };
    },
    watch: {
        propsData: {
            handler() {
                this.init();
            },
            deep: true,
            immediate: true,
        },
    },
    methods: {
        init() {
            const _this = this;
            if (_this.propsData.init) {
                return;
            }
            _this.paramsData = $.extend({}, _this.propsData);
            console.log(_this.paramsData);
        },
        async confirm() {
            return false;
        },
    },
}
